﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Booky.WinFormsClient
{
    public sealed class FileAssociationUtil
    {
        public void CreateBookyFileAssocation()
        {
            //TODO refactor
            //Associate File Extension with Booky 
            FileAssociation FA = new FileAssociation();
            FA.Extension = "booky";
            FA.ContentType = "application/booky";
            FA.FullName = "Booky Project File";
            FA.ProperName = "Booky";
            FA.AddCommand("open", string.Format("\"{0}\" \"%1\"", System.Reflection.Assembly.GetExecutingAssembly().Location));
            //"C:\\mydir\\myprog.exe %1");
            FA.IconPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            FA.IconIndex = 0;
            FA.Create();
            
        }
    }
}
